<?php


namespace app\auth\controller;


use app\auth\service\IndexService;
use app\common\controller\AdminBaseController;
use think\facade\Lang;
use think\facade\View;

class Index extends AdminBaseController
{
    /**
     * 默认方法
     * @return string
     */
    public function index() {
        $langType = cookie('system_lang');
        if ($langType == 'zh-cn') {
            $langName = '中文';
        }else if ($langType == 'en-us') {
            $langName = 'English';
        }else if ($langType == 'kr') {
            $langName = '한국어';
        }else if ($langType == 'jp-ja') {
            $langName = 'にっぽん';
        }else {
            $langName = '中文';
        }


        return View::fetch('index',[
            'menuData' => $this->menus,
            'userInfo' => session('admin'),
            'langName' => $langName
        ]);
    }

    /**
     * 欢迎页面
     */
    public function welcome()
    {
        return View::fetch('welcome');
    }

    public function menu() {
        return \view('menu');
    }
}